file_name = 'programming.txt'

# 写入文件
# with open(file_name, 'w') as file_object:
    # file_object.write("I love programming.\n")
    # file_object.write("I love Python.\n")

# 附加到文件
with open(file_name, 'a') as file_object:
    file_object.write('gaoshi\n')
    file_object.write('nol\n')
